<?php
/*
 * 车型库分类模版
 * @package    auto
 * @author     yunian
 * @copyright  Copyright (c) 2013 ixdcw team
 * @version    $Id: 0e19f636c4cd20345cc45ce0fa4d1252280fd6ad $
 */
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
<form method="post" action="?" id="mkForm" onsubmit="return check();">
	<input type="hidden" name="file" value="<?php echo $file;?>"/>
	<input type="hidden" name="action" value="<?php echo $action;?>"/>
	<input type="hidden" name="moduleid" value="<?php echo $moduleid;?>"/>
	<input type="hidden" name="typename" value="<?php echo $typename;?>"/>
	<div class="tt">添加 [<?php echo AutoCategory::typeDesc($do->getTypename());?>]</div>
	<table cellpadding="2" cellspacing="1" class="tb">
		<tr>
			<td class="tl"><span class="f_hid">*</span> 上级</td>
			<td>
				<?php echo Post::autocatTree('category[parentid]', $typename, '请选择', $parentid) ?>
				<?php tips('如果不选择，则为顶级分类');?>
			</td>
		</tr>
		<tr>
			<td class="tl"><span class="f_red">*</span> 名称</td>
			<td><textarea name="category[name]" id="name" style="width:200px;height:100px;overflow:visible;"></textarea><?php tips('允许批量添加，一行一个，点回车换行');?><br/><span id="dname" class="f_red"></span></td>
		</tr>
		<tr>
			<td class="tl"><span class="f_hid">*</span> 目录[英文名]</td>
			<td><input name="category[nickname]" type="text" id="nickname" size="20"/><input type="button" class="btn" value="目录检测" onclick="ckDir();"><?php tips('限[a-z]、[A-z]、[0-9]、_、- 、/<br/>该分类相关的html文件将保存在此目录<br/>如果需要生成多级目录，请用 / 分隔目录<br/>如果不填写则自动将分类id作为目录');?><span
					id="dnickname"class="f_red"></span></td>
		</tr>
		<tr>
			<td class="tl"><span class="f_hid">*</span> 字母索引</td>
			<td><input name="category[letter]" type="text" id="letter" size="2"/><?php tips('填写分类名称后系统会自动获取 如果没有获取成功请填写<br/>例如 分类名称为 新东 则填写 x');?></td>
		</tr>
		<tr>
			<td class="tl"><span class="f_hid">*</span> 搜索关键词</td>
			<td><input name="category[keyword]" type="text" id="letter" size="50"/><?php tips('后台搜索不到的关键词, 在这里加上便能够搜索到!车系可用!');?></td>
		</tr>
		<?php if (isset($FD) && !empty($FD))  echo AutoField::html('<td class="tl">', '<td>', $extInfo, $FD); ?>
		<tr>
			<td class="tl"><span class="f_hid">*</span> Title(SEO标题)</td>
			<td><input name="category[seo_title]" type="text" size="61"></td>
		</tr>
		<tr>
			<td class="tl"><span class="f_hid">*</span> Meta Keywords<br/>&nbsp; (网页关键词)</td>
			<td><textarea name="category[seo_keywords]" cols="60" rows="3" id="seo_keywords"></textarea></td>
		</tr>
		<tr>
			<td class="tl"><span class="f_hid">*</span> Meta Description<br/>&nbsp; (网页描述)</td>
			<td><textarea name="category[seo_description]" cols="60" rows="3" id="seo_description"></textarea></td>
		</tr>

	</table>
	<div class="sbt"><input type="submit" name="submit" value="确 定" class="btn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value="重 置" class="btn"/></div>
</form>
<script type="text/javascript">
	function ckDir() {
		if (Dd('nickname').value == '') {
			Dtip('请填写分类目录');
			Dd('nickname').focus();
			return false;
		}
		var url = '?file=category&typename=<?php echo $typename?>&action=cknickname&moduleid=<?php echo $moduleid;?>&nickname=' + Dd('nickname').value;
		Diframe(url, 0, 0, 1);
	}
	function check() {
		if (Dd('name').value == '') {
			Dmsg('请填写分类名称', 'catname');
			return false;
		}
		return true;
	}

</script>
<script type="text/javascript">
	Menuon(0);
	seajs.use(['utils', '$'], function(utils, $){
		utils.letter('name', 'letter', 1);
		utils.letter('name', 'nickname', 99);
		$('#parentid').change(function(){
			utils.goAndChange('parentid',$(this).val());
		});
	})
</script>
<?php include tpl('footer'); ?>